1 package jrre.instructionset.math;
2
3 import jrre.*;
4 import jrre.types.*;
5
6 public class IShl extends jrre.instructionset.Instruction {
7
8 public IShl(){
9
10 name = "ishl";
11 description = "foo foo moo poo";
12 length = 0;
13 }
14
15 /***
16 * Executes the <strong><code>ineg</code></strong> instruction.
17 *
18 */
19 public void execute(){
20
21 PrimitiveType valueTwo = (PrimitiveType)Stack.popOperand();
22 PrimitiveType valueOne = (PrimitiveType)Stack.popOperand();
23
24 int shiftedValue = valueOne.getValue() << valueTwo.getValue();
25 System.out.println("Shifting: "+valueOne.getValue() +" << "+valueTwo.getValue()+" = "+shiftedValue);
26
27 Stack.pushOperand(new PrimitiveType(shiftedValue));
28
29 }
30
31 public String toString(){
32 return "ishl";
33 }
34 }
This page was automatically generated by Maven